#include <stdio.h>

int str_to_int(char*str)// str = NULL
{
    //printf
    if(str == NULL)
        return -1;
	if(*str < '0' || *str > '9')
    {
        return -1;
    }
    int num = 0;
    while(*str)
    {
        if(*str >= '0' && *str <= '9')
        {
            num = num*10 + *str - '0';
        }
        else
        {
            return num;
        }
           

        str++;
    }

    return num;

}
//./a.out 111 222
int main(int argc, char**argv)
{
    if(argc != 3)
    {
        printf("输入参数有误\n");
        return -1;
    }
    int num1 = str_to_int(argv[1]);
    int num2 = str_to_int(argv[2]);

    printf("%d + %d = %d\n",num1, num2, num1+num2);
    
}